package edu.ycu.aladdin.web.controller.data;

import edu.ycu.aladdin.web.api.data.DataAPI;
import edu.ycu.aladdin.web.common.RestResponse;
import edu.ycu.aladdin.web.controller.AbsController;
import edu.ycu.aladdin.web.dto.DataLabel;
import edu.ycu.aladdin.web.service.LabelService;
import org.springframework.web.bind.annotation.*;

/**
 * 数据相关 Controller.
 *
 * @author <a href="mailto:wangruihuan@abitai.com">王瑞环</a>
 * @since 1.0
 */
@RestController
@RequestMapping("/data")
public class DataController extends AbsController implements DataAPI {

    private final LabelService labelService;

    public DataController(LabelService labelService) {
        this.labelService = labelService;
    }

    @Override
    public RestResponse labelData(DataLabel label, String sso){

        labelService.labelData(label,sso);
        return RestResponse.successResponse(null);
    }

    @Override
    public RestResponse getByDate(String start, String end){
        // TODO
        return null;
    }
}
